package com.gitee.target123.develop.common.httpclient;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "http.client")
public class HttpClientProperties {
    /**
     * 是否开启池化
     */
    private boolean poolEnabled = false;
    /**
     * 最大连接数
     */
    private int httpMaxPoolSize = 20;
    /**
     * 获取/建立连接超时时间
     */
    private int connectTimeout = 10000;
    /**
     * 获取数据超时时间
     */
    private int socketTimeout = 30000;
    /**
     * 最大空闲时间
     */
    private int maxIdleTime = 30000;

    public boolean isPoolEnabled() {
        return poolEnabled;
    }

    public void setPoolEnabled(boolean poolEnabled) {
        this.poolEnabled = poolEnabled;
    }

    public int getHttpMaxPoolSize() {
        return httpMaxPoolSize;
    }

    public void setHttpMaxPoolSize(int httpMaxPoolSize) {
        this.httpMaxPoolSize = httpMaxPoolSize;
    }

    public int getConnectTimeout() {
        return connectTimeout;
    }

    public void setConnectTimeout(int connectTimeout) {
        this.connectTimeout = connectTimeout;
    }

    public int getSocketTimeout() {
        return socketTimeout;
    }

    public void setSocketTimeout(int socketTimeout) {
        this.socketTimeout = socketTimeout;
    }

    public int getMaxIdleTime() {
        return maxIdleTime;
    }

    public void setMaxIdleTime(int maxIdleTime) {
        this.maxIdleTime = maxIdleTime;
    }
}
